#ifndef COMMON_H_
#define COMMON_H_

#include "commonSHM.h"

#define BORRA_BUFFER    while(getchar()!= '\n');


int fatal (char * msg);

int getLine (char * line, int linelen, FILE * stream);

unsigned int getFileSize(const char * file_name);

void catchAlarm(int sig);
ssize_t readWithTimeout(int fd, void *buf, size_t count, unsigned int timeout);
ssize_t writeWithTimeout(int fd, const void *buf, size_t count, unsigned int timeout);

void clrtext(char * text, int len);

int msgForServer (shmADT s);
int commit_fileSM (shmADT s, char * path, int type);

#endif /*COMMON_H_*/
